/**
 * 当链接中带有eruda=true的时候，加载调试工具eruda
 * @returns
 */
export const loadEruda = () => {
  if (!/eruda=true/.test(window.location.href)) return;
  const head = document.querySelector('head');
  const script = document.createElement('script');
  script.setAttribute('src', '//cdn.jsdelivr.net/npm/eruda');
  script.onload = () => window?.eruda?.init();
  head?.appendChild(script);
};
